<html>
<?php
  require_once 'header.php';
  $ConnectDB = new connectDB();
  $SQLList = new sqlList();

  $result = $ConnectDB->buildPreparedStatments($SQLList->SelectAllSong);
  $result->execute();
  $result->bind_result($idPoem, $title);
  $index = 0;
  while ( $rowSet = $result->fetch())
	{
	  $songId[$index] = $idPoem;
	  $songArr[$idPoem] = $title;
	  $index++;
	}
	$result->close();
?>
<body>
<h1>詩歌</h1>
<p>此詩歌庫目的，希望提供一個找詩歌的平台。( <a href="categorylist.php">分類</a> | <a href="func/search.php">搜尋</a> )</p>
<hr/>
<div>
<div style="float:left;">
  <ul>
  	<?php
  	foreach ($songId as $id)
  	{
      print "<li><a href='song.php?sid=" . $id . "'>" . $songArr[$id] . "</a></li>\n";
    }
  	?>
  </ul>
</div>

</div>

</html>